//
// Created by root on 17-8-29.
//
#ifndef CL_FACE_SPHEREFACE_H
#define CL_FACE_SPHEREFACE_H
#include "net_caffe.h"
#include "opencv2\opencv.hpp"

namespace fr
{
	class SphereFace {
	public:
		explicit SphereFace(int batch_size = 1, int channels = 3, int height = 112, int width = 96, bool do_flip = false);
		~SphereFace() {}

		std::vector<float> extract_feature(cv::Mat& aligned_face) const;

		bool load_model(const std::string& init_nets,
			const std::string& predict_nets);

	private:
		void preprocess(const cv::Mat& src,
			const std::vector<cv::Point2f>& landmarks,
			std::vector<float>&blob_data)const;
	private:
		int batch_size_;
		int channels_;
		int height_;
		int width_;
		bool do_flip_;
		bool do_ensemble_;
		std::shared_ptr<fr::NetCaffe> sphere20_;
		DISABLE_COPY_AND_ASSIGN(SphereFace);
	};
}





#endif //CL_FACE_SPHEREFACE_H
